Skip to main content

All Questions

7votes
4answers
942views

Project Euler #54: class for poker hands

I'm working right now on Project Euler problem 54, and I figured that this was the perfect opportunity to try to work with classes. This is my first time, so I'm sure that there are a lot of style, ...
Brais Romero's user avatar
6votes
2answers
232views

(HackerRank) Project Euler+ #250: 250250

Link to problem: linkNumber of solvers: 27 out of 844Solve rate (per person): 3.199%Success rate (over all submissions): 1.78% Project Euler+ on HackerRank is basically supposed to be a generalization ...
CrSb0001's user avatar
11votes
4answers
2kviews

Leetcode 93: Restore IP Addresses

(Source: Leetcode 93: Restore IP Addresses [Medium])(Topics: [String] [Backtracking]) The problem is as follows: Definition: A valid IP address is defined to consist of exactly four integers ...
CrSb0001's user avatar
5votes
5answers
840views

Bracket matching - Advent of Code 2021 Day 10

The following code solves Advent Of Code 2021 Day 10. The goal for this time around is evaluating whether a line of brackets is complete, has a syntax error or is missing some closing brackets. ...
138 Aspen's user avatar
2votes
1answer
50views

Optimal Extraction of Longest Sorted Sequence from Individually Sorted Bucket Arrays Without Repetitions

Consider a bucket array containing sorted and/or empty buckets, and the goal is to extract the longest possible sequence in sorted order, under the following conditions: Only one element in each ...
M.A.'s user avatar
  • 121
5votes
1answer
226views

Performance Tuning to enable answer for Project Euler #566 "Cake Icing Puzzle"

Related to this question I am still looking for a solution to Project Euler Problem 566 (see link for a nice simulation also): Adam plays the following game with his birthday cake. He cuts a piece ...
DuesserBaest's user avatar
1vote
1answer
136views

Read millions of integers from stdin and process them in Python within 2 seconds

This is a competitive programming problem which has never been solved in Python within the time limit of 2 seconds. It is about Disjoint Set Union: Source: Algorithms In Context #10: Disjoint Sets ...
Murilo Perrone's user avatar
6votes
2answers
722views

Making a Rock Paper Scissors game in Python - How to reduce repetition and make it more effective?

I am a "new" coder to Python - saying this because I got stuck in the tutorial hell - and I saw that doing projects was a way of consolidating what I had learnt from those tutorials, so here ...
Aldis Nuts's user avatar
4votes
1answer
180views

Roman numerals look and say sequence

I was practicing question 1 of the 2020 british informatics olympiad past paper: The Roman look-and-say description of a string (of Is, Vs, Xs, Ls, Cs, Ds and Ms) is made by taking each block of ...
sbottingota's user avatar
2votes
1answer
171views

Codewars 4 Kyu kata: "Most frequently used words in a text"

This was the first kata I found hard so I wanted to ask about it. Any ways I could I have done it better? here's the question -> Most frequently used words in a text ...
Afasys's user avatar
3votes
1answer
97views

Finding the number of "block chains" that are a certain length and begin with a certain string

I'm currently practicing for the british informatics olympiad by doing past papers. I was doing question 3 of the 2019 paper: A set of children’s blocks, each illustrated with a single different ...
sbottingota's user avatar
4votes
1answer
454views

Advent of Code 2023 day 1: Trebuchet

Part 1: The task involves analyzing a calibration document containing lines of text. Each line represents a calibration value that needs to be recovered by extracting the first and last digits and ...
Madagascar's user avatar
0votes
1answer
126views

HackerRank Project Euler 12 (Python) | Highly Divisible Triangular Numbers

I again share my Python code which didn't pass time limit test cases in the HackerRank contest of ProjectEuler. ...
peternish's user avatar
3votes
1answer
363views

Python function to find the count of digits of numerals in base n up to a given limit

This is a simple exercise to find the count of digits of all numerals in a given base up to a given limit (not including the limit), I wrote it to determine the ratio of bytes saved when the numbers ...
Ξένη Γήινος's user avatar
1vote
1answer
162views

Calculate the cost of Biryani lessons

Problem: According to a recent survey, Biryani is the most ordered food. Chef wants to learn how to make world-class Biryani from a MasterChef. The chef will be required to attend the MasterChef's ...
kvk30's user avatar

153050per page
close